// const initSqlJs = require('sql.js');
// const fs = require('fs');
// const path = require('path')
import fs from "fs";
import path from "path";
import initSqlJs from "sql.js";

export function getSQL() {
  const filebuffer = fs.readFileSync(path.resolve(__dirname, "../../data/sql.db"));
  initSqlJs().then(function (SQL: unknown) {
    // Load the db
    const db = new (SQL as any).Database(filebuffer);
    console.log(db);
    const result = db.exec("SELECT * FROM employees");
    console.log(result);
    console.log(result[0].columns);
    console.log(result[0].values);
  });
}
// module.exports = {getSQL}
